home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue26 / shiny / SHINY.ZIP / Main.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-08-23  |  2.4 KB  |  109 lines

  1. {====================================================================
  2.   TShiny component for DELPHI 3.x
  3.   970823 - Canberra - Australia
  4.  
  5.   http://www.geocities.com/SiliconValley/Bay/2111/
  6.   unclesisko@geocities.com
  7.  
  8.  
  9.   Description
  10.   ------------
  11.   It creates a shiny spot on the left-top corner of any control.
  12.   Attached demo program allows you to test TShiny component.
  13.  
  14.  
  15.  
  16.   E-Mail address:
  17.   ----------------
  18.   unclesisko@geocities.com
  19.  
  20.  
  21.   All the best...
  22.  
  23.  
  24.   "Knowledge has a value when you share it with others..."
  25.                                            A Turkish proverb
  26. ====================================================================}
  27. unit Main;
  28.  
  29. interface
  30.  
  31. uses
  32.   Shiney,
  33.   Windows, Classes, Forms,  ExtCtrls, StdCtrls, Controls;
  34.  
  35. type
  36.   TForm1 = class(TForm)
  37.     Button1: TButton;
  38.     Button2: TButton;
  39.     Button3: TButton;
  40.     Button4: TButton;
  41.     Timer1: TTimer;
  42.     ShineyWhite: TShiney;
  43.     ShineyRed: TShiney;
  44.     ShineyYellow: TShiney;
  45.     Timer2: TTimer;
  46.     Timer3: TTimer;
  47.     Label1: TLabel;
  48.     Label2: TLabel;
  49.     Label3: TLabel;
  50.     Label4: TLabel;
  51.     procedure Timer1Timer(Sender: TObject);
  52.     procedure Timer2Timer(Sender: TObject);
  53.     procedure Timer3Timer(Sender: TObject);
  54.   private
  55.     { Private declarations }
  56.   public
  57.     { Public declarations }
  58.   end;
  59.  
  60. var
  61.   Form1: TForm1;
  62.  
  63. implementation
  64.  
  65. {$R *.DFM}
  66.  
  67. procedure TForm1.Timer1Timer(Sender: TObject);
  68. var i : integer;
  69. begin
  70.   i := random(ComponentCount-1);
  71.   if (Components[i] is TControl) then begin
  72.     if (Components[i] as TControl).Visible then begin
  73.        ShineyRed.Shine(Components[i] as TControl);
  74.        (Components[i] as TControl).Repaint;
  75.     end;
  76.   end;
  77. end;
  78.  
  79.  
  80.  
  81. procedure TForm1.Timer2Timer(Sender: TObject);
  82. var i : integer;
  83. begin
  84.   i := random(ComponentCount-1);
  85.   if (Components[i] is TControl) then begin
  86.     if (Components[i] as TControl).Visible then begin
  87.        ShineyYellow.Shine(Components[i] as TControl);
  88.        (Components[i] as TControl).Repaint;
  89.     end;
  90.   end;
  91. end;
  92.  
  93. procedure TForm1.Timer3Timer(Sender: TObject);
  94. var i : integer;
  95. begin
  96.   i := random(ComponentCount-1);
  97.   if (Components[i] is TControl) then begin
  98.     if (Components[i] as TControl).Visible then begin
  99.        ShineyWhite.Shine(Components[i] as TControl);
  100.        (Components[i] as TControl).Repaint;
  101.     end;
  102.   end;
  103. end;
  104.  
  105.  
  106.  
  107.  
  108. end.
  109.